using RobotSimulator.Basic;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GPS : BasicSensor
{
    public Rigidbody rb;
    protected override void Start()
    {
        base.Start();
        if (rb == null)
        {
            rb = GetComponentInParent<Rigidbody>();
        }
    }
}
public class CmdGetGPS : CmdGetSensorData
{
    
    protected override string GetData(IEU ieu)
    {
        GPS gps = (GPS)ieu;
        Vector2 res=new Vector2( gps.rb.transform.position.z, gps.rb.transform.position.x );
        gps.output_data=JsonUtility.ToJson(res);
        return base.GetData(ieu);
    }
}
